package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Proserie entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PROSERIE", schema = "MANAGER", uniqueConstraints = {})
public class Proserie implements java.io.Serializable {

	// Fields

	private ProserieId id;
	private Producto producto;
	private Unimed unimed;
	private Bodega bodega;
	private String psnempresa;
	private Date psnfecini;
	private Date psnfecven;
	private Double psnexiste;
	private Timestamp psnlogfec;
	private Dlluser dlluser;
	// Constructors

	/** default constructor */
	public Proserie() {
	}

	/** minimal constructor */
	public Proserie(ProserieId id, Producto producto, Unimed unimed,
			Bodega bodega) {
		this.id = id;
		this.producto = producto;
		this.unimed = unimed;
		this.bodega = bodega;
	}

	/** full constructor */
	public Proserie(ProserieId id, Producto producto, Unimed unimed,
			Dlluser dlluser,Timestamp psnlogfec,
			Bodega bodega, String psnempresa, Date psnfecini, Date psnfecven,
			Double psnexiste) {
		this.id = id;
		this.producto = producto;
		this.unimed = unimed;
		this.psnlogfec = psnlogfec;
		this.dlluser = dlluser;
		this.bodega = bodega;
		this.psnempresa = psnempresa;
		this.psnfecini = psnfecini;
		this.psnfecven = psnfecven;
		this.psnexiste = psnexiste;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "psnproduct", column = @Column(name = "PSNPRODUCT", unique = false, nullable = false, insertable = true, updatable = true, length = 15)),
			@AttributeOverride(name = "psnserial", column = @Column(name = "PSNSERIAL", unique = false, nullable = false, insertable = true, updatable = true, length = 50)) })
	public ProserieId getId() {
		return this.id;
	}

	public void setId(ProserieId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PSNPRODUCT", unique = false, nullable = false, insertable = false, updatable = false)
	public Producto getProducto() {
		return this.producto;
	}

	public void setProducto(Producto producto) {
		this.producto = producto;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PSNUNIMED", unique = false, nullable = false, insertable = true, updatable = true)
	public Unimed getUnimed() {
		return this.unimed;
	}

	public void setUnimed(Unimed unimed) {
		this.unimed = unimed;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PSNBODEGA", unique = false, nullable = false, insertable = true, updatable = true)
	public Bodega getBodega() {
		return this.bodega;
	}

	public void setBodega(Bodega bodega) {
		this.bodega = bodega;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PSNLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "PSNLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getPsnlogfec() {
		return this.psnlogfec;
	}

	public void setPsnlogfec(Timestamp psnlogfec) {
		this.psnlogfec = psnlogfec;
	}
	
	@Column(name = "PSNEMPRESA", unique = false, nullable = true, insertable = true, updatable = true, length = 3)
	public String getPsnempresa() {
		return this.psnempresa;
	}

	public void setPsnempresa(String psnempresa) {
		this.psnempresa = psnempresa;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "PSNFECINI", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getPsnfecini() {
		return this.psnfecini;
	}

	public void setPsnfecini(Date psnfecini) {
		this.psnfecini = psnfecini;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "PSNFECVEN", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public Date getPsnfecven() {
		return this.psnfecven;
	}

	public void setPsnfecven(Date psnfecven) {
		this.psnfecven = psnfecven;
	}

	@Column(name = "PSNEXISTE", unique = false, nullable = true, insertable = true, updatable = true, precision = 12)
	public Double getPsnexiste() {
		return this.psnexiste;
	}

	public void setPsnexiste(Double psnexiste) {
		this.psnexiste = psnexiste;
	}

}